package ATMproject;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;

public class Inquire extends JPanel implements ActionListener {

    private JButton backBtn;

    private MainPage frame;

    private Icon backButton = Util.getIcon("/atmimage/buttonOff.jpg");

    //声明查询按钮
    private JLabel inquireText = new JLabel();

    public JLabel getInquireText() {
        return inquireText;
    }

    public void setInquireText(JLabel inquireText) {
        this.inquireText = inquireText;
    }

    public Inquire(MainPage frame) {
        this.frame = frame;

        this.setLayout(null);

        this.setOpaque(false);

//        JLabel titleLabel = new JLabel("查询");
//        titleLabel.setBounds(200, 50, 100, 50);
//        this.add(titleLabel);

        backBtn = new JButton(backButton);
        backBtn.setBounds(650, 150, 100, 50);
        this.add(backBtn);
        backBtn.addActionListener(this);

        inquireText.setBounds(380, 180, 200, 25);
        inquireText.setFont(new Font("黑体", Font.BOLD, 20));
        this.add(inquireText);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if (backBtn == e.getSource()) {
            frame.switchPanel("menu");
        }
    }
}
